<?php
//header('Access-Control-Allow-Origin: *');

	
	$username=$_GET['username'];
	$password=$_GET['password'];
	
			//连接数据库
			$db=mysqli_connect('127.0.0.1','root','','yltravel');
			//判断否连接成功
		//	echo "连接成功";
			if(!mysqli_connect_errno($db)){
				//连接成功
				//拿到用户名和密码
				$username=$_GET['username'];
				$password=$_GET['password'];
				//查找数据库
				$sql_select="SELECT username,password FROM info  WHERE username= '$username'&&password='$password'";
					
				$result= mysqli_query($db, $sql_select);
			
				//判断
				if(mysqli_affected_rows($db)){
					echo json_encode(['code'=>1,'msg'=>'success']);
				}else{
					echo json_encode(['code'=>0,'msg'=>'fail']);
				}
						
			}
			else{
				echo "连接失败";
			}
			
	

	
	
	
	
	
	
	
	
	
	

	
?>